package cn.juni.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @author Juni
 * @date 2021/2/24
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Orders {

    private String id;
    private String orderNum;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:ss")
    private Date orderTime;
    private Integer orderStatus;
    private Integer peopleCount;
    private Product product;
    private List<Traveller> travellers;
    private Member member;
    /**
     * 支付方式 0微信 1支付宝 2其他
     */
    private Integer payType=-1;
    private String payTypeStr;

    private String orderDesc;

    public String getPayTypeStr(){
        if(payType == 0){
            payTypeStr = "微信";
        }
        if(payType == 1){
            payTypeStr = "支付宝";
        }
        if(payType == 2){
            payTypeStr = "其他";
        }
        return payTypeStr;
    }
}